package  
{
	import flash.display.MovieClip;
	import flash.events.Event;
	import Level.Level;
	import Objetos.Heroi;
	/**
	 * ...
	 * @author Vitor Picchi
	 */
	public class Main extends MovieClip
	{
		protected var MC_Heroi :Heroi
		private var Levelstate :String
		public var MC_tela     :MovieClip
		private var LV_fase    :Level
		
		private static var _instance :Main = null;
		  
		public static function getInstance():Main
		{
			return _instance;
		}
		public static function getStage():Stage
		{
			return getInstance().stage;
		}
		
		public function Main()		
		
		{
			_instance = this;
			iniciarJogo();
			
			
			
			addEventListener(Event.ENTER_FRAME, update, false, 0, true)	
		}
		public function update(e:Event):void
		{
			switch (Levelstate)
			{
				case "level":
					LV_fase.update();
					break;
			}
		}
		public function iniciarJogo():void
		{
			MC_tela = new MovieClip();
			addChild(MC_tela);
			
			levelState = "Level";
			LV_fase1 = new Level
			addEventListener(Event.ENTER_FRAME, update , false, 0 , true)
			
			desenharTela();
		}
		public function desenharTela():void
		{
			switch(levelState)
			{
				case "Level":
					LV_fase.desenharTela();
					LV_fase.desenharArray();
					break;
			}
		}
	}
	    
}